﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class login : System.Web.UI.Page
{

    public String Name {
        set { }
        get { return UserTextBox.Text; }
    }

    public String Password
    {
        set { }
        get { return PasswordTextBox.Text; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        /*
        String user = UserTextBox.Text;
        String password = PasswordTextBox.Text;
        */
        Response.Cookies["User"].Value = Name;
        Response.Cookies["Password"].Value = Password;

        Response.Redirect("validateUser.aspx");

    }
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Session["MId"] == null)//會員
        {
            this.Page.MasterPageFile = "~/MasterPage.master";
        }
        else       //一般使用者
            this.Page.MasterPageFile = "~/LoginedMasterPage.master";
    }
   
}